package org.scauinfo.fpos.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Memberpermission entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "memberpermission", catalog = "db_fpos")
public class Memberpermission implements java.io.Serializable {

	// Fields

	private Integer id;
	private String mpermissionId;
	private String mpermissionName;
	private String mrules;
	private Set<Member> members = new HashSet<Member>(0);

	// Constructors

	/** default constructor */
	public Memberpermission() {
	}

	/** minimal constructor */
	public Memberpermission(String mpermissionId, String mpermissionName) {
		this.mpermissionId = mpermissionId;
		this.mpermissionName = mpermissionName;
	}

	/** full constructor */
	public Memberpermission(String mpermissionId, String mpermissionName,
			String mrules, Set<Member> members) {
		this.mpermissionId = mpermissionId;
		this.mpermissionName = mpermissionName;
		this.mrules = mrules;
		this.members = members;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "mpermission_id", nullable = false)
	public String getMpermissionId() {
		return this.mpermissionId;
	}

	public void setMpermissionId(String mpermissionId) {
		this.mpermissionId = mpermissionId;
	}

	@Column(name = "mpermission_name", nullable = false)
	public String getMpermissionName() {
		return this.mpermissionName;
	}

	public void setMpermissionName(String mpermissionName) {
		this.mpermissionName = mpermissionName;
	}

	@Column(name = "mrules")
	public String getMrules() {
		return this.mrules;
	}

	public void setMrules(String mrules) {
		this.mrules = mrules;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "memberpermission")
	public Set<Member> getMembers() {
		return this.members;
	}

	public void setMembers(Set<Member> members) {
		this.members = members;
	}

}